<div id="index" class="mt10">
<!-- Start of Main -->
<div class="main">
	<!-- Star of area3s -->
	<div class="area3s">
	<!-- Start of col1 -->
  	<div class="col1 mr18"> 
  		<?php $this->widget('SearchBox') ?>
        <?php if($this->beginCache('topicsListing', array('duration' => 15552000))) : ?>
		<?php $topics = TermsTaxonomy::model()->with('terms')->findAllByAttributes(array('taxonomy' => TermsTaxonomy::TAXONOMY_TOPIC)); ?>
        <div class="proNav">
            <h3>话题分类</h3>
            <p><strong><?php foreach($topics as $topic) { ?><a title="<?= $topic->terms->name; ?>" href="<?php echo CHtml::normalizeUrl(array('/posts/listbytopic', 'id' => $topic->terms->termId)) ?>" target="_blank"><?= $topic->terms->name; ?></a> | <?php } ?></strong>
            </p>
        </div>
        <?php $this->endCache() ?>
        <?php endif ?>
        <div class="cb"></div>
        <?php if($cache = Yii::app()->cache->get('hotPosts')) : ?>
        <?php echo $cache ?>
        <?php else : ?>
        <?php $this->widget('HotPosts'); ?>
        <?php endif ?>
    </div>
    <!-- End of col1 -->
    <!-- Start of col2 -->
    <div class="col2 mr18">
    	<div class="scrollAd" id="oSlidesBox">
    		<!-- Slides show generated by JavaScript -->
		</div>
        <!-- Start of advisory -->
        <div class="boxC advisory mt17">
        	<h3><span class="icon"></span><a href="<?php echo CHtml::normalizeUrl(array('/posts/category', 'id' => 32)); ?>" target="_blank">咨询专题</a><span class="more"><a href="<?php echo CHtml::normalizeUrl(array('/posts/category', 'id' => 32)); ?>" target="_blank">更多>></a></span></h3>
            <div class="headlines">
            	<h4><?php echo CHtml::link(truncStr($posts['咨询专题']['meta']->topPost->post->postTitle, 54, '...'), $posts['咨询专题']['meta']->topPost->post->getRewrittenUrl(), array('class' => 'cRed', 'target' => '_blank')); ?></h4>
                <p><?php echo truncStr(strip_tags($posts['咨询专题']['meta']->topPost->post->postContent), 384, '...'); ?>
                </p>           
            </div>
            <div class="boxCItems">
            	<?php foreach($posts['咨询专题']['rows'] as $k => $post) : ?>
            	<?php if(($k+1) % ($sectionSize/2) === 1) : ?>
            	<ul>
            	<?php endif; ?>
					<li><a href="<?php echo CHtml::normalizeUrl(array('/category/view', 'id' => $post->categories[0]->terms->termId)); ?>" title="<?php echo $post->categories[0]->terms->name;?>" class="cGre" target="_blank">『<?php echo $post->categories[0]->terms->name;?>』</a><a href="<?php echo $post->getRewrittenUrl(); ?>" title="<?php echo htmlspecialchars($post->postTitle) ?>" target="_blank"><?php echo truncStr(htmlspecialchars($post->postTitle), 42, '...'); ?></a></li>
            	<?php if(($k+1) % ($sectionSize/2) === 0) : ?>
				</ul>
            	<?php endif; ?>
				<?php endforeach; ?>
            </div>
        </div>
        <!-- End of advisory -->
        <div class="cb"></div>
        <!-- Start of 心理文叢 -->
        <?php if($this->beginCache('sectionBox_1', array('duration' => 3600*3))) : ?>
        <?php $this->widget('SectionBox', array('categoryId' => 1, 'subCategoryCount' => 7)) ?>
        <?php $this->endCache() ?>
        <?php endif ?>
        <!-- End of 心理文叢 -->
        <div class="cb"></div>
            
	</div>
    <!-- End of col2 -->
    <!-- Start of col3 -->
    <div class="col3">
    	<?php $this->widget('Inform'); ?>
    	<?php $this->widget('MustKnow'); ?>
        <?php $this->widget('RandomPsy'); ?>
        
    </div>
    <!-- End of col3 -->
    <div class="cb"></div>
    <div class="indexAd"></div>
    </div><!--End of area3s -->
    
    <!-- Start of area3s -->
    <div class="area3s">
    	<!--Start of col1-->
    	<div class="col1 mr18">
			<div class="smallAd"><?php echo CHtml::image(Yii::app()->baseUrl.'/images/a-exp1.png', '慧苑心理咨询专注于解决婚姻家庭亲子问题', array('title' => '慧苑心理咨询专注于解决婚姻家庭亲子问题')); ?></div>
            <?php $this->widget('RecommendPsytest') ?>
		    <?php $this->widget('HotThreads'); ?>
			<div class="mt10"></div>
	    	<?php $this->widget('Literal') ?>
    	</div>
    	<!--End of col1-->
    	<!--Start of col2-->
    	<div class="col2 mr18">
    		<!-- Start of estEAP -->
        <div class="boxC estEAP ">
        	<h3><span class="icon"></span><a href="<?php echo CHtml::normalizeUrl(array('/posts/category', 'id' => 11)); ?>" target="_blank">企业 EAP</a><span class="more"><a href="<?php echo CHtml::normalizeUrl(array('/posts/category', 'id' => 11)); ?>" target="_blank">更多&gt;&gt;</a></span></h3>
			<div class="headlines">
            	<h4><?php echo CHtml::link(truncStr($posts['企业 EAP']['meta']->topPost->post->postTitle, 54, '...'), $posts['企业 EAP']['meta']->topPost->post->getRewrittenUrl(), array('class' => 'cRed', 'target' => '_blank')); ?></h4>
               <p><?php echo truncStr(strip_tags($posts['企业 EAP']['meta']->topPost->post->postContent), 384, '...'); ?></p>           
            </div>
            <div class="boxCItems">
            	<?php foreach($posts['企业 EAP']['rows'] as $k => $post) : ?>
            	<?php if(($k+1) % ($sectionSize/2) === 1) : ?>
            	<ul>
            	<?php endif; ?>
                	<li><a href="<?php echo $post->getRewrittenUrl(); ?>" title="<?php echo $post->postTitle; ?>" target="_blank"><?php echo $post->postTitle; ?></a></li>
            	<?php if(($k+1) % ($sectionSize/2) === 0) : ?>
            	</ul>
            	<?php endif; ?>
                <?php endforeach; ?>
            </div>
        </div>
        <!-- End of estEAP -->
        <div class="cb"></div>
        <!-- Start of psyTest --><!--
         <div class="boxC psyTest mt10">
        	<h3><span class="icon"></span>心理测试<span class="more"><a href="#">更多&gt;&gt;</a></span></h3>
            <div class="boxCMain">
                <ul class="boxCTabs mt8">
                    <li><a href="#" class="linkOn">恋爱心理</a></li>
                    <li><a href="#">心理健康</a></li>
                    <li><a href="#">社交心理</a></li>
                    <li><a href="#">能力自测</a></li>
                    <li><a href="#">职场素质</a></li>
                    <li><a href="#">性格气质</a></li>
                </ul>
                <ul class="boxCLists">
                    <li>
                        <div class="first"><a href="#"><?= CHtml::image(Yii::app()->baseUrl.'/images/exp_img2.gif', ''); ?></a>
                        <a href="#">你的他被你宠坏了吗？</a></div>
                        <div class="listMain">
                            <dl>
                                <dd><a href="#">哪种美人是你的死穴</a></dd>
                                <dd><a href="#">你憧憬什么爱情模式</a></dd>
                                <dd><a href="#">你易得啥爱情精神病</a></dd>
                                <dd><a href="#">你是草食系OR肉食系</a></dd>
                                <dd class="ddNone"><a href="#">你的恋爱神经够好吗</a></dd>
                            </dl>
                            <dl>
                                <dd><a href="#">另一半劈腿你会怎样</a></dd>
                                <dd><a href="#">出轨会给你啥结局</a></dd>
                                <dd><a href="#">你的他被你宠坏了吗？</a></dd>
                                <dd><a href="#">你够格做清纯玉女吗</a></dd>
                                <dd class="ddNone"><a href="#">你会因什么而偷情</a></dd>
                            </dl>
                        </div>
                    </li>
                    <li style="display:none;">
                        2
                    </li>
                    <li style="display:none;">
                        3
                    </li>
                    <li style="display:none;">
                        4
                    </li>
                    <li style="display:none;">
                        5
                    </li>
                    <li style="display:none;">
                        6
                    </li>
                </ul>  
            </div>  
        </div>
        --><!-- End of psyTest -->
        
        
        <!-- Start of psyche -->
        <div class="boxC psyche mt10">
        	<h3><span class="icon"></span><a href="<?php echo CHtml::normalizeUrl(array('/posts/category', 'id' => 43)); ?>" target="_blank">咨询案例</a><span class="more"><a href="<?php echo CHtml::normalizeUrl(array('/posts/category', 'id' => 43)); ?>" target="_blank">更多&gt;&gt;</a></span></h3>
            <div class="headlines">
            	<h4><?php echo CHtml::link(truncStr($posts['咨询案例']['meta']->topPost->post->postTitle, 54, '...'), $posts['咨询案例']['meta']->topPost->post->getRewrittenUrl(), array('class' => 'cRed', 'target' => '_blank')); ?></h4>
                <p><?php echo truncStr(strip_tags($posts['咨询案例']['meta']->topPost->post->postContent), 384, '...'); ?>
                </p>           
            </div>
            <div class="boxCItems">
            	<?php foreach($posts['咨询案例']['rows'] as $k => $post) : ?>
            	<?php if(($k+1) % ($sectionSize/2) === 1) : ?>
            	<ul>
            	<?php endif; ?>
					<li><a href="<?php echo CHtml::normalizeUrl(array('/category/view', 'id' => $post->categories[0]->terms->termId)); ?>" title="<?php echo $post->categories[0]->terms->name ?>" class="cGre" target="_blank">『<?php echo $post->categories[0]->terms->name;?>』</a><a href="<?php echo $post->getRewrittenUrl(); ?>" title="<?php echo htmlspecialchars($post->postTitle) ?>" target="_blank"><?php echo truncStr(htmlspecialchars($post->postTitle), 42, '...'); ?></a></li>
            	<?php if(($k+1) % ($sectionSize/2) === 0) : ?>
				</ul>
            	<?php endif; ?>
				<?php endforeach; ?>
            </div>
        </div>
        <!-- End of psyche -->  
		<div class="cb"></div>
		<!-- Start of 心理學堂 -->
        <?php if($this->beginCache('sectionBox_8', array('duration' => 3600*3))) : ?>
        <?php $this->widget('SectionBox', array('categoryId' => 8, 'subCategoryCount' => 7)) ?>
        <?php $this->endCache() ?>
        <?php endif ?>
        <!-- End of 心理學堂 -->
		<div class="cb"></div>
		<!-- Start of 本心療法 -->
        <?php if($this->beginCache('sectionBox_64', array('duration' => 3600*3))) : ?>
        <?php $this->widget('SectionBox', array('categoryId' => 64, 'subCategoryCount' => 5)) ?>
        <?php $this->endCache() ?>
        <?php endif ?>
        <!-- End of 本心療法 -->
    	</div>
    	<!--End of col2-->
    	<!--Start of col3-->
    	<div class="col3">
    		<div class="help">
	        	<a href="<?php echo CHtml::normalizeUrl(array('/qas')); ?>" class="hBtn1" target="_blank">在线问吧</a>
	            <a href="<?php echo CHtml::normalizeUrl(array('/psychologist/qqlist')) ?>" id="qqListLink" class="hBtn2">QQ 在线咨询</a>
	            <a href="<?php echo CHtml::normalizeUrl(array('/contact')) ?>" class="hBtn4">联系我们</a>
			</div>
            <?php if($this->beginCache('hot-psytests', array('duration' => 604800))) : ?>
            <?php $this->widget('HotPsytests') ?>
            <?php $this->endCache() ?>
            <?php endif ?>
			<div class="smallAd mt10"><?php echo CHtml::image(Yii::app()->baseUrl.'/images/a-exp2.png', '慧苑心理咨询专注于解决婚姻家庭亲子问题', array('title' => '慧苑心理咨询专注于解决婚姻家庭亲子问题', 'style' => 'width: 190px')); ?></div>
	        <?php $this->widget('Map') ?>
	        <?php $this->widget('ColumnStaticBlock1') ?>
    	</div>
    	<!--End of col3-->
    	<div class="cb"></div>    	
    </div>
    <!-- End of area3s -->	
	<div class="friendly-link">
		<h3 class="friendly-title">友情链接</h3>
		<ul>
		<?php foreach($links as $link) : ?>
			<li><a href="<?php echo $link->linkTo ?>" target="_blank" title="<?php echo $link->desName ?>"><?php echo $link->desName ?><!-- <img src="<?php echo $link->imageUrl ?>" width="90" height="30" alt="<?php echo $link->desName ?>" title="<?php echo $link->desName ?>" /> --></a></li>
		<?php endforeach ?>
		</ul>
   </div>

</div>
<!-- End of Main --> 

</div>
<script type="text/javascript">
    // Show and H section box
    $('ul.boxCLists li.flagToJc').hide();
</script>
